<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page language= "java" contentType="text/html;charset=UTF-8"%> 
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
        <script src="<%=request.getContextPath()%>/jquery/jquery.js"></script>
        <script src="<%=request.getContextPath()%>/jquery/validation/jquery.validate.js"></script>
        
        <link href="<%=request.getContextPath()%>/jquery/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <p><s:text name="text.register"/></p>
        <s:form action="userRegister" id="registerForm">
            <s:textfield id="email" key="label.email" name="user.email" labelposition="left"/>
            <s:textfield id="username" key="label.username" name="user.username" />
            <s:password id="password" key="label.password" name="user.password" />
            <s:password id="password2" key="label.password2" name="user.password2"/>
            <s:submit key="button.submit"/>
            <s:reset key="button.reset" />
        </s:form>
        
        <script>
            $(document).ready(function(){
                $("#button.submit").addClass("ui-button");
                $("#email").addClass("required email");
                $("#username").addClass("required").attr("minlength","2").attr("maxlength","20");
                $("#password").addClass("required").attr("minlength","2").attr("maxlength","20");
                $("#password2").addClass("required").attr("minlength","2").attr("maxlength","20").attr("equalTo","#password");
                $("#registerForm").validate();
            });
        </script>
    </body>
</html>
